package com.sds.sweng.swat.miplatform.ui.design.models.area.sub;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.sds.sweng.swat.miplatform.ui.design.models.MiplatformComponent;
import com.sds.sweng.swat.miplatform.ui.design.models.MiplatformContainer;

public class SubAreaContainer extends MiplatformContainer {

	public SubAreaContainer() {
	}

	@JsonIgnore
	public int getTableSubAreaCount() {
		int tableSubAreaCount = 0;

		for (MiplatformComponent subArea : getChildren()) {
			if (subArea instanceof TableSubArea)
				tableSubAreaCount++;
		}

		return tableSubAreaCount;
	}

	public SubAreaContainer clone() {
		SubAreaContainer clone = (SubAreaContainer) super.clone();

		for (MiplatformComponent child : getChildren()) {
			clone.addChild(child.clone());
		}

		return clone;
	}
}
